package com.jwb.pub.dao;

import com.alibaba.fastjson.JSONObject;
import com.jwb.pub.model.JavaModel;
import com.jwb.pub.model.JavaSql;
import com.jwb.pub.model.Page;
import org.apache.ibatis.session.SqlSession;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;


public interface BaseDAO {


	public SqlSession getSession();

	public void closeSession(SqlSession session);
	
	public String getDataBaseNameInUppercase();
	
	public int findBySqlCnt(String strsql) throws Exception;
	
	public JSONObject findBySqlToJosn(String strsql) throws Exception;
	
	public JSONObject findBySqlToJosn(String strsql,String listname) throws Exception;
	public JSONObject findBySqlToJosn(String strsql, Page page) throws Exception;
	
	public JSONObject findBySqlToJosn(String strsql, Page page,String listname) throws Exception;
	
	public boolean excuteSql(String strsql,ArrayList<JavaModel> list);
	public JSONObject excuteProSql(String strpro,List<String> pamList);
	
	public boolean excuteBatchSql(Map<String,ArrayList<JavaModel>> map);
	public boolean excuteBatchOrderedSql(LinkedHashMap<String,ArrayList<JavaModel>> map);
	public boolean excuteBatchOrderedSqlEx(LinkedHashMap<JavaSql,ArrayList<JavaModel>> map);
	
	public boolean replaceSql(String tableName,String whereSql,String setSql,ArrayList<JavaModel> params);
	
	public int getMaxId(String table , String keyId);
	public int getMaxId(String table , String keyId,String condition);
	
	public int getSeqId(String dbName , String tableName);
	
}
